package com.erp.erp_ui.warehouse.enums;

/**
 * @ClassName : ResourceSamplesTypeEnum
 * @Description : 资源样品业务类型枚举
 * @Author : lst
 * @Date: 2020-11-30 18:27
 */
public enum ResourceSamplesTypeEnum {

    REGISTER(1, "登记"),
    TAKE_OUT(2, "领出");

    /**
     * id
     */
    private int id;

    /**
     * 描述
     */
    private String desc;

    public int getId() {
        return id;
    }

    public String getDesc() {
        return desc;
    }

    ResourceSamplesTypeEnum(int id, String desc) {
        this.id = id;
        this.desc = desc;
    }

    /**
     * 通过id获取描述信息
     * @param id
     * @return
     */
    public static String getDescById(int id){
        for(ResourceSamplesTypeEnum resourceSamplesTypeEnum : ResourceSamplesTypeEnum.values()){
            if(resourceSamplesTypeEnum.getId() == id){
                return resourceSamplesTypeEnum.getDesc();
            }
        }
        return "";
    }
}
